package org.example.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Description: 本地缓存配置
 * Created by 陈宇 on 2024-12-28 16:12
 * Created with IntelliJ IDEA.
 * @author 陈宇
 */
@Configuration
public class CacheConfig {

    @Bean
    public ConcurrentHashMap<String, ConcurrentHashMap<String, Object>> mapCacheManager() {
        ConcurrentHashMap<String, ConcurrentHashMap<String, Object>> cacheManager = new ConcurrentHashMap<>();
        ConcurrentHashMap<String, Object> nodeIdCache = new ConcurrentHashMap<>();
        ConcurrentHashMap<String, Object> communityOpenRankCache = new ConcurrentHashMap<>();
        ConcurrentHashMap<String, Object> nodeIdR = new ConcurrentHashMap<>();
        cacheManager.put("nodeId", nodeIdCache);
        cacheManager.put("communityOpenRankCache", communityOpenRankCache);
        cacheManager.put("nodeIdR", nodeIdR);
        return cacheManager;
    }

}

